<?php

echo "</br>Location:  mail_create_view</br>";

echo form_open('messages/mail_create_submit');
echo validation_errors('<p class="error">','</p>');

$family_list = array();
//$iteration = '0';
foreach ($data as $key => $row) {
    //echo $row -> getID();
    //echo " ";
    //echo $row -> getfamilyName();
    //echo "</br>";
    
    $family_list[$row -> getId()] = $row -> getfamilyName();
    //$family_list[$iteration]['id'] = $row -> getId();
    //$iteration++;
}

echo "<label for=\"family_from\">Message From: </label>";
echo form_dropdown('family_from',$family_list);

echo "<label for=\"family_to\">Message To: </label>";
echo form_dropdown('family_to',$family_list);

$msgtype = array(
    '1' => 'PtoP Mail (1)',
    '2' => 'Birth (2)',
    '3' => 'Death (3)',
    '4' => 'Other (4)',
    );

$importance = array(
    '1' => 'Critical (1)',
    '2' => 'Very High (2)',
    '3' => 'High (3)',
    '4' => 'Normal (4)',
    );


echo form_dropdown('importance',$importance,'4');
echo form_dropdown('msgtype',$msgtype);

echo "</br><label for=\"msgbody\">Message Body: (255 character max)</label>";
$textformat = array(
    'name' => 'msgbody',
    'id' => 'msgbody',
    'cols' => '25',
    'rows' => '5',
);
echo form_textarea($textformat);
      
echo form_submit('submit','Submit');
echo form_close();

echo "</br>";

echo "<p>";
echo form_open('main/index');
echo form_submit('submit','Main');
echo form_close();
echo "</p>";